/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.lang.reflect.Field;
/*     */ import java.lang.reflect.ParameterizedType;
/*     */ import java.util.Iterator;
/*     */ import java.util.Set;
/*     */ import java.util.concurrent.ConcurrentHashMap;
/*     */ import java.util.concurrent.ConcurrentLinkedQueue;
/*     */ import java.util.concurrent.ConcurrentSkipListSet;
/*     */ import net.minecraft.block.Block;
/*     */ import net.minecraft.block.state.IBlockState;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.renderer.RenderGlobal;
/*     */ import net.minecraft.util.math.BlockPos;
/*     */ import net.minecraft.world.EnumSkyBlock;
/*     */ import net.minecraft.world.IBlockAccess;
/*     */ import net.minecraft.world.World;
/*     */ import net.minecraftforge.common.MinecraftForge;
/*     */ import net.minecraftforge.fml.client.FMLClientHandler;
/*     */ import net.minecraftforge.fml.common.Mod;
/*     */ import net.minecraftforge.fml.common.Mod.EventHandler;
/*     */ import net.minecraftforge.fml.common.Mod.Instance;
/*     */ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
/*     */ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
/*     */ import net.minecraftforge.fml.common.gameevent.TickEvent;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @Mod(modid = "dynamiclights_dragoncore", name = "Dynamic Lights DragonCore", version = "1.4.9", clientSideOnly = true, dependencies = "required-after:forge@[14.23.3.2698,)", acceptedMinecraftVersions = "[1.12.2]")
/*     */ public class aia
/*     */ {
/*     */   private Minecraft d;
/*     */   @Instance("dynamiclights_dragoncore")
/*     */   private static aia z;
/*     */   private IBlockAccess i;
/*     */   private ConcurrentLinkedQueue<eca> w;
/*     */   private ConcurrentHashMap<World, ConcurrentLinkedQueue<eca>> q;
/*     */   private static boolean g;
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLPreInitializationEvent fMLPreInitializationEvent) {
/*  68 */     this.d = FMLClientHandler.instance().getClient();
/*  69 */     this.q = new ConcurrentHashMap<>();
/*  70 */     MinecraftForge.EVENT_BUS.register(this);
/*  71 */     g = false;
/*     */   }
/*     */ 
/*     */   
/*     */   @SubscribeEvent
/*     */   public void v(TickEvent.ClientTickEvent clientTickEvent) {
/*  77 */     if (!nm.g) {
/*     */       return;
/*     */     }
/*  80 */     if (clientTickEvent.phase == TickEvent.Phase.END && this.d.field_71441_e != null) {
/*  81 */       ConcurrentLinkedQueue concurrentLinkedQueue = this.q.get(this.d.field_71441_e);
/*     */       
/*  83 */       if (concurrentLinkedQueue != null) {
/*  84 */         Iterator<eca> iterator = concurrentLinkedQueue.iterator();
/*  85 */         while (iterator.hasNext()) {
/*  86 */           eca eca = iterator.next();
/*  87 */           if (eca.v()) {
/*  88 */             iterator.remove();
/*  89 */             this.d.field_71441_e.func_180500_c(EnumSkyBlock.BLOCK, new BlockPos(eca.h(), eca.z(), eca.v()));
/*     */           } 
/*     */         } 
/*     */       } 
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static int v(Block a, IBlockState iBlockState, IBlockAccess iBlockAccess, BlockPos blockPos) {
/* 111 */     int i = a.getLightValue(iBlockState, iBlockAccess, blockPos);
/* 112 */     if (!nm.g) {
/* 113 */       return i;
/*     */     }
/* 115 */     if (z == null || !(iBlockAccess instanceof net.minecraft.client.multiplayer.WorldClient)) {
/* 116 */       return i;
/*     */     }
/*     */ 
/*     */     
/* 120 */     if (!iBlockAccess.equals(z.i) || z.w == null) {
/* 121 */       z.i = iBlockAccess;
/* 122 */       z.w = z.q.get(iBlockAccess);
/* 123 */       v();
/*     */     } 
/*     */     
/* 126 */     int j = 0;
/* 127 */     if (z.w != null && !z.w.isEmpty()) {
/* 128 */       for (eca eca : z.w) {
/* 129 */         if (eca.h() == blockPos.func_177958_n() && eca.z() == blockPos.func_177956_o() && eca.v() == blockPos.func_177952_p()) {
/* 130 */           j = Math.max(j, eca.v().v());
/*     */         }
/*     */       } 
/*     */     }
/* 134 */     return Math.max(i, j);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void z(ba a) {
/* 179 */     if (a.v() != null) {
/* 180 */       if (a.v().func_70089_S()) {
/* 181 */         eca eca = new eca(a);
/* 182 */         ConcurrentLinkedQueue<eca> concurrentLinkedQueue = z.q.get((a.v()).field_70170_p);
/* 183 */         if (concurrentLinkedQueue != null) {
/* 184 */           if (!concurrentLinkedQueue.contains(eca)) {
/* 185 */             concurrentLinkedQueue.add(eca);
/*     */           } else {
/* 187 */             System.out.println("Cannot add Dynamic Light: Attachment Entity is already registered!");
/*     */           } 
/*     */         } else {
/* 190 */           concurrentLinkedQueue = new ConcurrentLinkedQueue<>();
/* 191 */           concurrentLinkedQueue.add(eca);
/* 192 */           z.q.put((a.v()).field_70170_p, concurrentLinkedQueue);
/*     */         }
/*     */       
/*     */       }
/*     */       else {
/*     */         
/* 198 */         System.err.println("Cannot add Dynamic Light: Attachment Entity is dead or in a banned dimension!");
/*     */       } 
/*     */     } else {
/* 201 */       System.err.println("Cannot add Dynamic Light: Attachment Entity is null!");
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(ba a) {
/* 212 */     if (a != null && a.v() != null) {
/* 213 */       World world = (a.v()).field_70170_p;
/* 214 */       if (world != null) {
/* 215 */         eca eca = null;
/* 216 */         ConcurrentLinkedQueue concurrentLinkedQueue = z.q.get(world);
/* 217 */         if (concurrentLinkedQueue != null) {
/* 218 */           Iterator<eca> iterator = concurrentLinkedQueue.iterator();
/* 219 */           while (iterator.hasNext()) {
/* 220 */             eca = iterator.next();
/* 221 */             if (eca.v().equals(a)) {
/* 222 */               iterator.remove();
/*     */               
/*     */               break;
/*     */             } 
/*     */           } 
/* 227 */           if (eca != null)
/* 228 */             world.func_180500_c(EnumSkyBlock.BLOCK, new BlockPos(eca.h(), eca.z(), eca.v())); 
/*     */         } 
/*     */       } 
/*     */     } 
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\aia.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */